<%-- 
    Document   : edit_akun
    Created on : Dec 10, 2013, 7:38:47 AM
    Author     : brlnt
--%>
<%@include file="../template/header.jsp" %>
<%
    UserBean userdata;
    boolean messagePassword = false;
    int role = 0;
    UserBean sesiUser = (UserBean) session.getAttribute("sesiUser");
    if (request.getAttribute("editprofil") != null) {
        userdata = (UserBean) request.getAttribute("editprofil");
    } else if (request.getAttribute("error") != null) {
        userdata = (UserBean) request.getAttribute("error");
        messagePassword = true;
    } else {
        userdata = null;
    }
%>
<script src="${initParam.js}/parsley.js"></script>
<script src="${initParam.js}/parsley.extend.js"></script>
<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <form action=".${alamat}" method="POST" parsley-validate novalidate>
            <fieldset>
                <h3>${title}</h3>
                <hr>
                <% if (request.getAttribute("messageSuccess") != null) { %>
                    <div class="alert alert-success">${messageSuccess}</div>
                    <label></label>
                <% } %>
                <label>Nama Depan</label>
                <input type="text" class="form-control" placeholder="Nama Depan" name="namaDepan" value="<%=userdata.getFirstName()%>" parsley-maxlength="50" parsley-required="true">
                <label>Nama Belakang</label>
                <input type="text" class="form-control" placeholder="Nama Belakang" name="namaBelakang" value="<%=userdata.getLastName()%>" parsley-maxlength="50" parsley-required="true">
                <label>Alamat Surel</label>
                <input type="email" class="form-control" placeholder="surel@contoh.co.id" name="email" value="<%=userdata.getEmail()%>" readonly="readonly" parsley-required="true" parsley-maxlength="254">
                <label>Kata Sandi Lama</label>
                <input type="password" class="form-control" name="password-lama" value="">
                <% if (messagePassword) {%>
                <ul class="parsley-error-list">
                    <li style="display: list-item;">
                        ${messagePassword}
                    </li>
                </ul>
                <% }%>
                <label>Kata Sandi Baru</label>
                <input type="password" class="form-control" name="password" id="password" parsley-equalto="#konfirm-password" value="">
                <label>Konfirmasi Kata Sandi Baru</label>
                <input type="password" class="form-control" name="konfirmasiPassword" id="konfirm-password" parsley-equalto="#password" value="" >
                <label></label>
                <button type="submit" class="btn btn-primary form-control">${tombol}</button>
            </fieldset>
        </form>
    </div>
</div>
<%@include file="../template/footer.jsp" %>